package com.rc.pojo.dto.user;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class AddUserDTO {
    @NotBlank(message = "用户姓名不能为空")
    @ApiModelProperty("员工姓名")
    private String name;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("员工用户名")
    private String username;

    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    @ApiModelProperty("员工电话")
    private String phone;

    @Range(min = 0, max = 1,message = "性别数据有无")
    @ApiModelProperty("员工性别0男 1女")
    private Integer sex;

    @Length(min = 18, max = 18, message = "身份证长度有误")
    @ApiModelProperty("员工身份证")
    private String idNumber;
}
